package com.bwie.handler;

import com.bwie.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author 牛毅
 * @version 1.0
 * @date 2025/7/17
 * @description TODO
 */
@ControllerAdvice
@Slf4j
public class GloBalExciption {

    /**
     * @description: 全局异常
     * @param: null
     * @return:
     * @author 牛毅
     * @date: 2025/7/17 19:34
     */
    @ExceptionHandler(value = Exception.class)
    @ResponseBody
    public R GloException(Exception e){
        return R.ERROR(500,e.getMessage());
    }
}
